package sams.ck.entity;

import java.util.Objects;

public class Student {
	//定义属性，要学生数据表一致
	private String stuId;//学生学号
	private String stuClass;//学生班级
	private String stuName;//学生姓名
	private Double EnglisScore;//英语分数
	private Double ChineseScore;//语文分数
	private Double MathScore;//数学分数
	
	//为学生实体类型添加无参构造方法
	public Student() {}

	//添加属性的get和set方法
	public String getStuId() {
		return stuId;
	}

	public void setStuId(String stuId) {
		this.stuId = stuId;
	}

	public String getStuClass() {
		return stuClass;
	}

	public void setStuClass(String stuClass) {
		this.stuClass = stuClass;
	}

	public String getStuName() {
		return stuName;
	}

	public void setStuName(String stuName) {
		this.stuName = stuName;
	}

	public Double getEnglisScore() {
		return EnglisScore;
	}

	public void setEnglisScore(Double englisScore) {
		EnglisScore = englisScore;
	}

	public Double getChineseScore() {
		return ChineseScore;
	}

	public void setChineseScore(Double chineseScore) {
		ChineseScore = chineseScore;
	}

	public Double getMathScore() {
		return MathScore;
	}

	public void setMathScore(Double mathScore) {
		MathScore = mathScore;
	}

	//添加hashCode 和equals方法
	
	@Override
	public int hashCode() {
		return Objects.hash(stuId);
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		Student other = (Student) obj;
		return Objects.equals(stuId, other.stuId);
	}

	//添加一个 toString 方法 便于测试用
	@Override
	public String toString() {
		return "Student [stuId=" + stuId + ", stuClass=" + stuClass + ", stuName=" + stuName + ", EnglisScore="
				+ EnglisScore + ", ChineseScore=" + ChineseScore + ", MathScore=" + MathScore + "]";
	}
}
